const state = {
  requireListData: new Object(),
  requireSearchHistory: null
};

const getters = {
  require(state) {
    return state.requireListData
  },
  requireSearchHistory(state) {
    return state.searchHistory
  }
};

const mutations = {
  // 保存项目信息数据
  SET_REQUIRELISTDATA (state, data) {
    state.requireListData = data;
  },
  // 保存项目信息筛选记录, 用于下次判断是否根据筛选记录来请求数据。
  SET_SEARCHHISTORY (state, data){
    state.requireSearchHistory = data;
  }
};

const actions = {
  storageRequireList ( {commit}, data ) {
    commit('SET_REQUIRELISTDATA',data)
  },
  storageSearchHistory ({commit}, data) {
    commit('SET_SEARCHHISTORY', data)
  }

};

export default {
  state,
  getters,
  actions,
  mutations
}
